import request from '@/utils/request'

export default {
  login (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/login',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修月统计
  bxChartMonth (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-chart-month',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 年楼宇维修排行
  bxTpoLyMonth (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-toply-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 班车统计当天每个时间段人数
  getBusDateChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-date-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 班次满员统计
  getBusAllChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-all',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 班车订单
  getBusOrder (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-order',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 班车订单状态
  getBusStatus () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-status',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修订单
  getBxOrder (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-order',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修搜索条件
  getBxSearch () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-search',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修搜索条件,根据校区获取维修地址
  getBxSearchAddress (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-search-address',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 查询学生楼宇扫码
  getStuTrack (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/lyuser',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // PC能源信息列表
  getPcEnergy (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/pc-energy',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 能源楼宇
  getBuildeEnergy () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/builde-energy',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 水电暖总电量分析
  getTotalEnergy (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/total-energy',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 楼宇用（电水暖气）分析
  getBuildeChartEnergy (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/builde-chart-energy',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 能源总量-同步统计
  getChartEnergyCapacity (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/total-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 班车查询
  getBusChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修统计分析
  getBxChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-to-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 维修-楼宇分析
  getBxLyChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-ly-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 工程列表
  getProject (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/project',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 工程信息统计
  getProjectsChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/project-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 设备信息
  getEquipment (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/equipment',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 设备统计
  getEquipmentChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/equipment-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 设备分类获取
  getEquipmentClass () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/equipment-class',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 根据校区获取楼宇
  getBuilde (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/builde',
        method: 'get',
        params: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 校园规划楼宇信息
  getBuildingInfo (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/gh-louyu',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 校园规划楼宇
  getGhly () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/ghly',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 校园规划在建楼宇信息
  getConstructionBuildingInfo (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/gh-zhou',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 在建楼宇信息-楼宇获取
  getGhzo (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/ghzo',
        method: 'get',
        params: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 商品分类获取
  getCanteenCategory () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cant-category',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 食堂获取
  getCanteenByType (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cant',
        method: 'get',
        params: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 食堂获取
  getCanteen () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cant',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 食堂统计
  getKtcantChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/ktcantChart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 餐饮-食堂采购统计
  getCantChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cantChart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 餐饮-消费营收分析
  getCantRevenueChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cant-revenue',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 餐饮-一卡通食堂获取
  getKtCanteen () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/ktcant',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 餐饮食堂信息-楼宇获取
  getCantentClass () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cantent-class',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 餐饮-餐饮用电统计分析
  getCantentChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/cantent-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 房间信息-楼宇获取
  getRoomClass () {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/room-class',
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 房间信息-房间获取
  getRoomClassName (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/room-class/' + params.id,
        method: 'get'
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 房间信息-查询
  getDianbiao (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/dianbiao',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 房间用电统计分析
  getFjChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/dianbiao-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 房间用电分析查询
  getRoomChartList (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/room-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 用电排行
  getYdChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/room-top',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 用电排行
  getBusYujing (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-yujing',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 首页-当日班车预约
  getBusTodayChart (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bus-today-chart',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  },
  // 首页-当日校区报修
  getBxTodayXq (params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/api/bx-today-xq',
        method: 'post',
        data: params
      }).then((data) => {
        resolve(data)
      }).catch((error) => {
        reject(error)
      })
    })
  }
}
